;( function () {
	"use strict";
    var param_map = Result.getLocationParamObject();
    var global_param_map;
	
	$( function () {
		if(!ifUser()){
			return;
		}
		$("#tijao").click(function(){
			tijao();
		});
	}); 

	
	function tijao(){
		var content = $("#content").val();
		if(content === null || content == ""){
			$("body").tips("请填写评价");
			return;
		}
		var params = {
			"userId" : 	USER.userId,
		};
		params.content = content;
		$.ajax(
				getAjaxOps('/suggest/addUserSuggestion', params)
		).done(function(res){
			if(res.resultCode == 0) {
				$("body").tips("提交成功");
				window.history.go(-1);
			} else {
				$("body").tips(res.data);
			}  
		});
	}
	
	
	/**
	 * 跳到首页
	 */
	window.toIndex = function(){
		Result.forward("index.html", {});
	};
	
	/**
	 * 跳到用户信息
	 */
	window.toUserInfo = function(){
		Result.forward("userInfos.html", {});
	};
	
	

}( window ) );
